package com.efesco.payroll.classItem;

import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.SqlDataset;
import com.bstek.dorado.common.*;
import com.efesco.common.FinalDefine;

/**
 * DataContract_datasetProductsListener
 */
public class DataContract_datasetProductsListener extends AbstractDatasetListener {
  public boolean beforeLoadData(Dataset dataset) throws Exception {
	  String sql="";
	  SqlDataset ds=(SqlDataset)dataset;
	  String typeCategory=""+FinalDefine.ptCategory_YANGLAO+","+FinalDefine.ptCategory_YILAO+","
	     +""+FinalDefine.ptCategory_SHIYE+","+FinalDefine.ptCategory_GONGJI+","+FinalDefine.ptCategory_BUCHONGGONGJI+"";
	  sql="select p.product_id,p.product_name from s_product p,s_product_type pt "
		 +"where p.product_type_id=pt.product_type_id "
		 +"and pt.type_category in("+typeCategory+") order by pt.type_category";
      ds.setSql(sql);
      return true;
  }

  public void afterLoadData(Dataset dataset) throws Exception {

  }

}
